package com.ruoyi.project.mgcmanage.controller;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.mgcmanage.domain.Storage;
import com.ruoyi.project.mgcmanage.service.IStorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/mgcmanage/storage")
public class StorageController extends BaseController {
    @Autowired
    private IStorageService iStorageService;

    /**
     * 查询新增采购后的药品和批量的数据列表
     * @return
     */
    @GetMapping("/list")
    public AjaxResult getStorageInfo(){
        return AjaxResult.success(iStorageService.listSelect());
    }

    /**
     * 把药品信息和批量信息分别添加到数据列表中
     * @param storage
     * @return
     */
    @PostMapping
    public AjaxResult AddStorage(@RequestBody Storage storage){
        return toAjax(iStorageService.addStorage(storage));
    }



}
